#include <stdio.h>

int main(void)
{
    float loan, rate, monthly_payment, first, second, third;

    printf("Enter amount of loan: ");
    scanf("%f", &loan);
    printf("enter interest rate: ");
    scanf("%f", &rate);
    printf("Enter monthly payment: ");
    scanf("%f", &monthly_payment);

    first = loan * (1 + rate / 1200) - monthly_payment;
    second = first * (1 + rate / 1200) - monthly_payment;
    third = second * (1 + rate / 1200) - monthly_payment;

    printf("Balance remaining after fist payment: $%.2f\n", first);
    printf("Balance remaining after second payment: $%.2f\n", second);
    printf("Balance remaining after third payment: $%.2f", third);

    return 0;
}
